<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
pageContext.setAttribute("basePath",basePath);
%>
<!DOCTYPE html>
<html lang="zh-cn">
	<head>
		<meta charset="UTF-8">
		<title>试题列表</title>

		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap-responsive.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/bootstrap/css/bootstrap.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/basic.css">
		<link rel="stylesheet" type="text/css" href="${basePath}resources/css/login.css">

		<script type="text/javascript" src="${basePath}resources/js/common/base.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/common/jquery-3.2.1.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/bootstrap/js/bootstrap.js"></script>
		<script type="text/javascript" src="${basePath}resources/angular-1.3.0/angular.min.js"></script>
		<script type="text/javascript" src="${basePath}resources/js/question.js?t=20170604"></script>
	</head>
	<body ng-app="myApp" ng-controller="questionController">
		<div id="header">
			<%@ include file="common/header.jsp" %>
			<h1>试题列表</h1>
			<div><a href="{{questionAddUrl}}">添加试题</a></div>
			<div><a href="{{questionAddByExcel}}">通过Excel导入试题</a></div>
		</div>
		<div id="container">
			<form onsubmit="return false;" method="post" name="loginForm" novalidate>
				<p>
					<label class="label label-length" for="searchQustionId">根据试题ID查询</label>
					<input type="text" name="searchQustionId" ng-model="searchQustionId" placeholder="试题ID" required />
					<input type="submit" class="btn btn-primary" name="searchBtn" id="searchBtn" value="查询" ng-click="search()" ng-disabled="loginForm.$invalid"/>
					<input type="button" class="btn btn-primary" name="refreshBtn" id="refreshBtn" value="刷新" ng-click="refresh()" ng-disabled="1==2"/>
				</p>
				<div>
					<table class="table">
						<thead>
							<tr>
								<th>序号</th>
								<th>问题内容</th>
								<th>问题详情</th>
							</tr>
						</thead>
						<tbody>
							<tr ng-repeat="x in questionList">
								<td>{{$index+1}}</td>
								<td>{{x.questionContent}}</td>
								<td><a href="${basePath}admin/question/detail/{{x.questionId}}" title="查看问题详情">详情</a></td>
							</tr>
						</tbody>
					</table>
				</div>
			</form>
		</div>
		<div id="footer">
			<%@ include file="common/footer.jsp" %>
		</div>
	</body>
</html>